package com.spiro.common;

import com.spiro.common.tutorial.Calculator;
import org.apache.thrift.TProcessor;

/**
 * Created by tz0643 on 2016/6/28.
 */
public abstract class BaseJavaServer {

    protected final int port;
    protected final TProcessor processor;

    public int getPort() {
        return port;
    }

    public BaseJavaServer(int port) {
        this.port = port;
        CalculatorHandler handler = new CalculatorHandler();
        processor = new Calculator.Processor(handler);
    }

    public abstract void serve();
}
